<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>确定变量的类型</title>
</head>

<body>
    <p>typeof 运算符返回变量或表达式的类型。</p>

    <p id="demo"></p>
    <script>
        document.getElementById("demo").innerHTML =
            typeof "" + "<br>" +
            typeof "Bill" + "<br>" +
            typeof "Bill Gates" + "<br>" +
            typeof 0 + "<br>" +
            typeof 314 + "<br>" +
            typeof 3.14 + "<br>" +
            typeof (3.14);
    </script>
</body>

</html>